{% extends "base.html"  %}
{% load static %}
{% block link %}
<link rel="shortcut icon" href="{% static "favicon.ico" %}">
<link rel="stylesheet" href="{% static "css/common.css" %}">
<link rel="stylesheet" href="{% static "css/user.css" %}">
{% endblock %}

{% block body  %}
<body class="member">
<div class="header">
<a href="/" class="logo"><img src="{% static "image/logo.jpg" %}"></a>
<div class="search-box">
    <form id="searchForm" action="{% url 'search' 1 %}" method="post">
    {% csrf_token %}
        <div class="search-keyword">
        <input id="kword" name="kword" type="text" class="keyword" maxlength="120">
        </div>
        <input id="subSerch" type="submit" class="search-button" value="搜 索">
    </form>
    <div id="suggest" class="search-suggest"></div>
    <div class="search-hot-words">
        {% for s in searchs %}
            <a target="play" href="{% url 'play' s.document.id %}">{{ s.document.name }}</a>
        {% endfor %}
    </div>
</div>
</div><!--end header-->

<div class="nav-box">
<div class="nav-box-inner">
    <ul class="nav clearfix">
        <li><a href="{% url 'index' %}">首页</a></li>
        <li><a href="{% url 'ranking' %}" target="_blank">公文排行</a></li>
        <li><a href="{% url 'home' 1 %}" target="_blank">用户中心</a></li>
    </ul>
</div>
</div><!--end nav-box-->

<div class="mod_profile js_user_data" style="">
<div class="section_inner">
    <div class="profile__cover_link">
        <img src="{% static "image/user.jpg" %}" class="profile__cover">
    </div>
    <h1 class="profile__tit">
        <span class="profile__name">{{ user.username }}</span>
    </h1>
        <a href="{% url 'logout' %}" style="color:white;">退出登录</a>
        <br>
        <a href="{% url 'upload' %}" style="color:white;">上传公文</a>
</div>
</div>

<div class="main main--profile" style="">
<div class="mod_tab profile_nav" role="nav" id="nav">
    <span class="mod_tab__item mod_tab__current" id="hear_tab">我看过的公文</span>
</div>
<div class="js_box" style="display: block;">
<div class="profile_cont">
<div class="js_sub" style="display: block;">
<div class="mod_songlist">
    <ul class="songlist__header">
        <li class="songlist__header_name">公文</li>
        <!--<li class="songlist__header_author">上传者</li>-->
        <li class="songlist__header_time">上传者</li>
    </ul>
    <ul class="songlist__list">
        {% for item in pages.object_list %}
        <li>
            <div class="songlist__item songlist__item--even">
            <div class="songlist__songname">
                <a href="{% url 'play' item.id %}" class="js_song songlist__songname_txt" >{{ item.name }}</a>
            </div>
            <!--<div class="songlist__artist">
                <a href="javascript:;" class="singer_name">{{ item.time }}</a>
            </div>-->
            <div class="songlist__time">{{ item.singer }}</div>
            </div>
        </li>
        {% endfor %}
    </ul>
</div><!--end mod_songlist-->

<!--分页-->
<div class="page-box">
    <div class="pagebar" id="pageBar">

        {% if pages.has_previous %}
        <a href="{% url 'home' pages.previous_page_number %}" class="prev" target="_self"><i></i>上一页</a>
        {% endif %}

        {% for page in pages.paginator.page_range %}
            {% if pages.number == page %}
                <span class="sel">{{ page }}</span>
            {% else %}
                <a href="{% url 'home' page %}" target="_self">{{ page }}</a>
            {% endif %}
        {% endfor %}

        {% if pages.has_next %}
        <a href="{% url 'home' pages.next_page_number %}" class="next" target="_self">下一页<i></i></a>
        {% endif %}
    </div>
</div>
</div>
</div>
</div>
</div>
</body>
{% endblock  %}